package com.foreveross.vo;

import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * VisitorCheckIn entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "visitor_check_in", catalog = "hrtenement")
public class VisitorCheckIn implements java.io.Serializable {

	// Fields

	private String id;
	private HouseUser houseUser;
	private String name;
	private String address;
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date endTime;
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date verifyTime;
	private String verifyStatus;
	private String wechatId;
	private Integer count;
	private String ticket;
	private String ticketId;
	private String randomId;
	private String states;

	// Constructors

	/** default constructor */
	public VisitorCheckIn() {
	}

	/** minimal constructor */
	public VisitorCheckIn(String id) {
		this.id = id;
	}

	/** full constructor */

	public VisitorCheckIn(String id, HouseUser houseUser, String name,
			String address, Date endTime, Date verifyTime, String verifyStatus,
			String wechatId, Integer count, String ticket,String ticketId,String randomId) {
		this.id = id;
		this.houseUser = houseUser;
		this.name = name;
		this.address = address;
		this.endTime = endTime;
		this.verifyTime = verifyTime;
		this.verifyStatus = verifyStatus;
		this.wechatId = wechatId;
		this.count = count;
		this.ticket = ticket;
		this.ticketId = ticketId;
		this.randomId = randomId;
	}
	
	public VisitorCheckIn(String id, HouseUser houseUser, String name,
			String address, Date endTime, Date verifyTime, String verifyStatus,
			String wechatId, Integer count, String ticket,String ticketId,String randomId,String states) {
		this.id = id;
		this.houseUser = houseUser;
		this.name = name;
		this.address = address;
		this.endTime = endTime;
		this.verifyTime = verifyTime;
		this.verifyStatus = verifyStatus;
		this.wechatId = wechatId;
		this.count = count;
		this.ticket = ticket;
		this.ticketId = ticketId;
		this.randomId = randomId;
		this.states=states;
	}

	// Property accessors
	@Id
	@GenericGenerator(name = "idGenerator", strategy = "uuid")
	@GeneratedValue(generator = "idGenerator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	@NotFound(action = NotFoundAction.IGNORE)
	public HouseUser getHouseUser() {
		return this.houseUser;
	}

	public void setHouseUser(HouseUser houseUser) {
		this.houseUser = houseUser;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "address")
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "end_time")
	public Date getEndTime() {
		return this.endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@Column(name = "verify_time")
	public Date getVerifyTime() {
		return this.verifyTime;
	}

	public void setVerifyTime(Date verifyTime) {
		this.verifyTime = verifyTime;
	}

	@Column(name = "verify_status")
	public String getVerifyStatus() {
		return this.verifyStatus;
	}

	public void setVerifyStatus(String verifyStatus) {
		this.verifyStatus = verifyStatus;
	}

	@Column(name = "wechat_id")
	public String getWechatId() {
		return wechatId;
	}

	public void setWechatId(String wechatId) {
		this.wechatId = wechatId;
	}

	@Column(name = "count")
	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	@Column(name = "ticket")
	public String getTicket() {
		return ticket;
	}

	public void setTicket(String ticket) {
		this.ticket = ticket;
	}

	@Transient
	public String getStates() {
	   return this.states;
	}

	public void setStates(String states) {
		this.states = states;
	}

	@Column(name = "ticket_id")
	public String getTicketId() {
		return ticketId;
	}

	public void setTicketId(String ticketId) {
		this.ticketId = ticketId;
	}
	
	@Column(name = "random_id")
	public String getRandomId() {
		return randomId;
	}

	public void setRandomId(String randomId) {
		this.randomId = randomId;
	}
}